<template>
  <div class="callSetup">
    <el-scrollbar class="callSetup-scrollbar" wrap-class="callSetup-scrollbar__wrap">
      <el-form :model="form" size="small" label-width="100px" :hide-required-asterisk="true" :rules="rules" ref="form">
        <el-form-item label="是否重播" prop="enabled">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">否</el-radio-button>
            <el-radio-button label="1">是</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="重播次数" prop="enabled" v-show="radio1 == 1">
          <el-select v-model="value" placeholder="请选择">
            <el-option v-for="(item,index) in timer" :key="timer[index]" :label="timer[index]" :value="timer[index]">
            </el-option>
          </el-select>
          <span style="color:white">次</span>
        </el-form-item>
        <el-form-item label="重播间隔" prop="enabled" v-show="radio1 == 1">
          <el-select v-model="value" placeholder="请选择">
            <el-option v-for="(item,index) in timer" :key="timer[index]" :label="timer[index]" :value="timer[index]">
            </el-option>
          </el-select>
          <span style="color:white">秒</span>
        </el-form-item>
        <el-form-item label="快速呼叫" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">语音呼叫</el-radio-button>
            <el-radio-button label="1">视频呼叫</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="组呼模式" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">同时呼叫</el-radio-button>
            <el-radio-button label="1">顺序呼叫</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="选呼模式" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">同时呼叫</el-radio-button>
            <el-radio-button label="1">顺序呼叫</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="强呼模式" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">同时呼叫</el-radio-button>
            <el-radio-button label="1">顺序呼叫</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="视频联动" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">自动切换</el-radio-button>
            <el-radio-button label="1">手动切换</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="广播模式" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">循环追呼</el-radio-button>
            <el-radio-button label="1">不追呼</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="循环模式" prop="enabled" v-show="radio1 == 0">
          <el-select v-model="value" placeholder="请选择">
            <el-option v-for="(item,index) in timer" :key="timer[index]" :label="timer[index]" :value="timer[index]">
            </el-option>
          </el-select>
          <span style="color:white">次</span>
        </el-form-item>
        <el-form-item label="点名模式" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">同时呼叫</el-radio-button>
            <el-radio-button label="1">顺序呼叫</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="点名方式" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">默认</el-radio-button>
            <el-radio-button label="1">自定义</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="告警广播" prop="phone">
          <el-radio-group v-model="radio1">
            <el-radio-button label="0">开</el-radio-button>
            <el-radio-button label="1">关</el-radio-button>
          </el-radio-group>
        </el-form-item>
      </el-form>
    </el-scrollbar>
  </div>
</template>

<script>
export default {
  props: {},
  data() {
    return {
      radio1: '0',
      timer: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
      form: {},
      typeOptions: [
        { value: 'hand_microphone', label: '手咪' },
        { value: 'phone', label: '手柄' },
      ],
      rules: {
        password: [
          { required: true, message: '请输入用户密码', trigger: 'blur' },
          { pattern: /^[A-Za-z0-9]{1,}$/, message: '只支持字母和数字' },
        ],
        sipHost: [
          { required: true, message: '请输入SIP服务器IP', trigger: 'blur' },
          {
            pattern: /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
            message: 'IP格式错误',
          },
        ],
        sipPort: [
          { required: true, message: '请输入SIP端口', trigger: 'blur' },
          {
            pattern: /^(([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5]))$/,
            message: '请输入0-65535范围内的数字',
          },
        ],
        wsHost: [
          { required: true, message: '请输入WS服务器IP', trigger: 'blur' },
          {
            pattern: /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
            message: 'IP格式错误',
          },
        ],
        wsPort: [
          { required: true, message: '请输入WS端口', trigger: 'blur' },
          {
            pattern: /^(([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5]))$/,
            message: '请输入0-65535范围内的数字',
          },
        ],
      },
    }
  },
  methods: {
    // 保存
    handleSubmit() {},
  },
  mounted() {},
}
</script>

<style lang="scss" scoped>
.callSetup {
  height: 100%;
  .callSetup-scrollbar {
    height: 100%;
  }
  /deep/.callSetup-scrollbar__wrap {
    width: auto;
    overflow-x: hidden;
    margin-right: -20px !important;
  }
  .el-form {
    .el-form-item {
      /deep/.el-form-item__label {
        color: #fff;
      }
      /deep/.el-input__inner {
        // width: 45%;
        background-color: #1a4969;
        color: #fff;
      }
      /deep/.el-switch__label {
        color: #fff;
        &.is-active {
          color: #13ce66;
        }
      }
      // /deep/.el-input__suffix {
      //   // right: 55%;
      // }
      .el-select--small {
        width: 24%;
      }
      /deep/.el-radio-button:last-child .el-radio-button__inner {
        width: 100px;
      }
      /deep/.el-radio-button__orig-radio:checked + .el-radio-button__inner {
        width: 100px;
      }
      /deep/.el-radio-button:first-child .el-radio-button__inner {
        width: 100px;
      }
    }
  }
}
</style>